package com.aiobc.file.exceptions;


import com.aiobc.file.enums.RespCodeEnum;

/**
 * @author fengzh
 * @className FileUploadException
 * @date 2020/4/22 18:46
 */
public class FileUploadException extends RuntimeException {
    private String code;

    private static final long serialVersionUID = -8205573723309228090L;

    public FileUploadException() {
        super();
    }

    public FileUploadException(String code, String message) {
        super(message);
        setCode(code);
    }

    public FileUploadException(RespCodeEnum respCodeEnum) {
        super(respCodeEnum.getMessage());
    }

    public FileUploadException(String message) {
        super(message);
        setCode(RespCodeEnum.FAIL.getCode());
    }

    public FileUploadException(String message, Throwable cause) {
        super(message, cause);
    }

    public FileUploadException(Throwable ex) {
        super(ex);
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

}
